package test;

class Emp implements Cloneable {
    private String ename;
    private String job;
    public Emp(String ename,String job) {
        this.ename = ename;
        this.job = job;
    }
    @Override
    public String toString() {
        return "【test.Emp - " + super.toString() + "】姓名：" + this.ename + " 、职位：" + this.job;
    }
    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class YootkDemo8 {
    public static void main(String[] args) throws Exception {
        Emp empA = new Emp("张三","程序员");
        Emp empB = (Emp)empA.clone();
        System.out.println(empA);
        System.out.println(empB);
    }
}
